/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package LOGICA.BDLSF;

import LOGICA.Entidades.Logdepart;
import LOGICA.HibernateUtil.HibernateUtil;
import java.util.List;
import org.hibernate.Session;

/**
 *
 * @author ricardo
 */
public class BDL_C_SFDepartamentoBean implements BDL_C_SFDepartamentoBeanRemota{

    @Override
    public List<Logdepart> findAllDepart() {
        List<Logdepart> listaDepart = null;
        Session sesion = HibernateUtil.getSessionFactory().getCurrentSession();
        String sql = "FROM Logdepart";
        try{
            sesion.beginTransaction();
            listaDepart = sesion.createQuery(sql).list();
            sesion.beginTransaction().commit();
        }catch(Exception e){
            sesion.beginTransaction().rollback();
        }
        return listaDepart;
    }
    
    
    
}
